package com.chushouya.manager.constants;

import com.general.framework.core.enums.IEnum;

import java.util.Objects;

/**
 * 发送类型(1手动发送/2定时发送)
 */
public enum PublishTypeEnum implements IEnum<Integer> {

    right_now(1, "手动发送"),
    delay(    2, "定时发送"),
    system(   3, "系统发送")
    ;

    private Integer value;

    private String desc;

    PublishTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (PublishTypeEnum thisEnum : PublishTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
